
import java.net.NetworkInterface;
import java.util.Enumeration;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author leehoa
 */
public class CheckNIC {
    
    
    public static void main(String[] args) {
        checkNetwork();
    }    
    
    public static void checkNetwork(){
        try{
            Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();  
            while (interfaces.hasMoreElements()) {  
                NetworkInterface nic = interfaces.nextElement();  
                System.out.print("Interface Name : [" + nic.getDisplayName() + "]");  
                System.out.println(", Is connected : [" + nic.isUp() + "]");  
            }     
        }catch(Exception e){
        }        
        
    }
    
    
}


